package com.framework.mybatis.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.framework.mybatis.entity.BaseEntity;

import java.util.List;

/**
 * @author lihanbo
 */
public interface BaseService<T extends BaseEntity> {
    List<T> list(Wrapper<T> wrapper);

    IPage<T> list(Integer pageNum, Integer pageSize, Wrapper<T> wrapper);

    Integer save(T entity);

    Integer update(T entity);

    Integer update(T entity, Wrapper<T> wrapper);

    long count();

    long count(Wrapper<T> wrapper);

    T first(Wrapper<T> wrapper);

    T getById(Long id);

    Integer delete(Long id);

    Integer delete(Wrapper<T> wrapper);

    Integer remove(T entity);
}
